home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games 1996 December / Amiga Games 1996 #12.iso / rexx / checkdir.vzrx < prev    next >
Text File  |  1996-09-10  |  1KB  |  53 lines

  1. /*
  2.    $VER: CheckDir.vzrx 1.01 (30.9.95)
  3.          © 1995 by Georg Hörmann
  4.  
  5.    Template: CheckDir.vzrx DIR/A,QUIT/S
  6.  
  7.       DIR:  Must be a valid path.
  8.       QUIT: If VirusZ has been started from the script, you can
  9.             quit after checking by specifying this option.
  10.  
  11.    If VirusZ is not running, it will be started from the
  12.    script (and quitted afterwards if requested).
  13. */
  14.  
  15. Prog_VirusZ = "dh0:VZ" /* You may change this */
  16.  
  17. options results
  18. options failat 99
  19.  
  20. UseQuitFlag = "no"
  21.  
  22. parse upper arg DirToCheck QuitFlag
  23. if DirToCheck = "" then do
  24.     say "No directory specified."
  25.     exit
  26.     end
  27.  
  28. if ~show(ports,VIRUSZ_II.REXX) then do
  29.     say "Starting VirusZ..."
  30.     address command Prog_VirusZ
  31.     UseQuitFlag = "yes"
  32.     StartTime = time(seconds)
  33.     do while ~show(ports,VIRUSZ_II.REXX)
  34.         if time(seconds) - StartTime > 20 then do
  35.             say "Error loading VirusZ!"
  36.             exit
  37.             end
  38.         end
  39.     end
  40.  
  41. address VIRUSZ_II.REXX CHECKDIR DirToCheck DECREXEC DECRDATA
  42.  
  43. if rc=0 then say "Directory is clean."
  44. if rc=5 then say "Directory contains virus!"
  45. if rc=10 then say "Error checking directory!"
  46.  
  47. if UseQuitFlag = "yes" then do
  48.     if QuitFlag = "QUIT" then do
  49.         say "Quitting VirusZ..."
  50.         address VIRUSZ_II.REXX QUIT
  51.         end
  52.     end
  53.